<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Trance extends Model
{
    protected $table = 'trance';
    public function cat()
    {
        return $this->belongsTo(Cats::class);
    }

    public function scopeWhereCatTitleLike(Builder $query, string $value)
    {
        return $query->whereHas('cat', function ($q) use ($value) {
            $q->where('title', 'like', "%{$value}%");
        });
    }
}
